<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>业务管理客管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnExport").click(function () {
                top.$.jBox.confirm("确认要导出用户数据吗？", "系统提示", function (v, h, f) {
                    if (v == "ok") {
                        $("#searchForm").attr("action", "${ctx}/sys/user/export");
                        $("#searchForm").submit();
                    }
                }, {buttonsFocus: 1});
                top.$('.jbox-body .jbox-icon').css('top', '55px');
            });
            $("#btnImport").click(function () {
                $.jBox($("#importBox").html(), {
                    title: "导入数据", buttons: {"关闭": true},
                    bottomText: "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
                });
            });
        });
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<div id="importBox" class="hide">
    <form id="importForm" action="${ctx}/meibanguserandclient/meibangUserAndClient/import"
          method="post" enctype="multipart/form-data"
          class="form-search" style="padding-left:20px;text-align:center;"
          onsubmit="loading('正在导入，请稍等...');"><br/>
        <input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
        <input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
        <a href="${ctxStatic}/tpl/template.xls">下载模板</a>
    </form>
</div>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/meibanguserandclient/meibangUserAndClient/">业务管理客列表</a></li>
    <%--<li><a href="${ctx}/meibanguserandclient/meibangUserAndClient/form">业务管理客添加</a></li>--%>
</ul>
<form:form id="searchForm" modelAttribute="meibangUserAndClient"
           action="${ctx}/meibanguserandclient/meibangUserAndClient/" method="post"
           class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <ul class="ul-form">
        <li><label>归属者：</label>
            <sys:treeselect id="master" name="master.id" value="${meibangUserAndClient.master.id}"
                            labelName="master.name" labelValue="${meibangUserAndClient.master.name}"
                            title="用户" url="/sys/user/treeDataForUser" cssClass="input-small"
                            allowClear="true" notAllowSelectParent="true"/>
        </li>
        <li><label>业务客：</label>
            <sys:treeselect id="user" name="user.id" value="${meibangUserAndClient.user.id}"
                            labelName="user.name" labelValue="${meibangUserAndClient.user.name}"
                            title="用户" url="/sys/user/treeDataForUser" cssClass="input-small"
                            allowClear="true" notAllowSelectParent="true"/>
        </li>
        <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
        </li>
        <li class="btns"><input id="btnImport" class="btn btn-primary" type="button" value="导入列表"/>
        </li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>归属者</th>
        <th>业务客</th>
        <th>备注</th>
        <th>更新时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="meibangUserAndClient">
        <tr>
            <td>
                <a href="${ctx}/meibanguserandclient/meibangUserAndClient/form?id=${meibangUserAndClient.id}">
                        ${meibangUserAndClient.master.name}
                </a></td>
            <td>
                    ${meibangUserAndClient.user.name}
            </td>
            <td>
                    ${meibangUserAndClient.remark}
            </td>
            <td>
                <fmt:formatDate value="${meibangUserAndClient.updateDate}"
                                pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <a href="${ctx}/meibanguserandclient/meibangUserAndClient/form?id=${meibangUserAndClient.id}">修改</a>
                <a href="${ctx}/meibanguserandclient/meibangUserAndClient/delete?id=${meibangUserAndClient.id}"
                   onclick="return confirmx('确认要删除该业务管理客吗？', this.href)">删除</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>